package com.jxb;

import org.apache.rocketmq.common.message.MessageQueue;

import java.util.ArrayList;
import java.util.List;

public class Tets {

    public static void main(String[] args) {
//        int index = tpInfo.getSendWhichQueue().incrementAndGet();
//        for (int i = 0; i < tpInfo.getMessageQueueList().size(); i++) {
//            int pos = Math.abs(index++) % tpInfo.getMessageQueueList().size();
//            if (pos < 0)
//                pos = 0;
//            MessageQueue mq = tpInfo.getMessageQueueList().get(pos);
//            if (latencyFaultTolerance.isAvailable(mq.getBrokerName()))
//                return mq;
//        }

        List<Integer> getMessageQueueList = new ArrayList<>();
        for (int i = 0; i < 12; i++) {
            getMessageQueueList.add(i);
        }

        int index = 2;

        for (int i = 0; i < 12; i++) {
            int pos = Math.abs(index++) % 12;

            if (pos < 0)
                pos = 0;
            Integer mq = getMessageQueueList.get(pos);
            System.out.println(mq);
        }

    }
}
